from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy

from .models import *


class UserProfileAdmin(UserAdmin):
    list_display = ['username', 'last_login', 'is_superuser', 'is_staff', 'is_active', 'date_joined']
    fieldsets = (
        (None, {'fields': ('username', 'password', 'first_name', 'last_name', 'email', 'introduction')}),

        (gettext_lazy('用户信息'), {'fields': ('nickname', 'gender', 'sign', 'age', 'student_id', 'tel')}),

        (gettext_lazy('Permissions'), {'fields': ('is_superuser', 'is_staff', 'is_active',
                                                  'groups', 'user_permissions')}),

        (gettext_lazy('Important dates'), {'fields': ('last_login', 'date_joined')}),
    )


admin.site.register(User, UserProfileAdmin)
